<?php

/*
 * This file is part of the gedongdong/laravel_rbac_permission.
 *
 * (c) gedongdong <gedongdong2010@163.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('email', 50)->unique()->comment('邮箱');
            $table->string('name', 50)->comment('姓名');
            $table->string('password', 188)->comment('密码');
            $table->tinyInteger('administrator')->default(2)->comment('是否超管，1是，2否');
            $table->tinyInteger('status')->default(1)->comment('状态，1启用，2禁用');
            $table->integer('creator_id')->comment('创建者id');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
            $table->charset = 'utf8mb4';
            $table->engine = 'InnoDB';
            $table->autoIncrement = 1;
            $table->comment = '用户表';
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
